1 REM <CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H> <CTRL-M>********************************<CTRL-M> DOS TUTORIAL<CTRL-M>********************************<CTRL-M>
3 REM <CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H> <CTRL-M>================================<CTRL-M> PUBLIC SERVICE RESEARCH AND<CTRL-M> COMPUTER LAB, NORTH CAROLINA<CTRL-M> STATE UNIVERSITY<CTRL-M>================================<CTRL-M>
5 REM <CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H> <CTRL-M>================================<CTRL-M> THANKS TO DON WORTH AND PIETER<CTRL-M> LECHNER, AUTHORS OF BENEATH<CTRL-M> APPLE DOS (QUALITY SOFTWARE)<CTRL-M>================================<CTRL-M>
8 REM <CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H> <CTRL-M>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><CTRL-M> USES<CTRL-M>VTOC.INFO,CATALOG.INFO,CATALOG.<CTRL-M>2,T/S LIST.INFO, HELLO T0A S0A,<CTRL-M> TRAC 1.9, AND TRAC 2.2<CTRL-M>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><CTRL-M>
13 REM <CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H> <CTRL-M>********************************<CTRL-M> SUBMENU LIST<CTRL-M>********************************<CTRL-M>
14 HOME
15 TEXT : HOME : VTAB 6: ONERR GOTO 40
20 D$ = CHR$(13) + CHR$(4)
41 HOME : PRINT : FOR I = 1 TO 40: PRINT "*";: NEXT : PRINT
42 STRING$ = "DOS TUTORIAL": GOSUB 1310: PRINT : FOR I = 1 TO 40: PRINT "*";: NEXT : PRINT
44 PRINT : PRINT : PRINT :STRING$ = "1. THE VOLUME TABLE OF CONTENTS": GOSUB 1210
46 STRING$ = "2. THE CATALOG": GOSUB 1210
48 STRING$ = "3. THE TRACK/SECTOR LIST": GOSUB 1210
102 PRINT "THIS IS THE VTOC - THE VOLUME TABLE OF": PRINT "CONTENTS.": PRINT : PRINT "IT IS NORMALLY FOUND ON TRACK": PRINT "$11 (17), SECTOR $00 (0). ";: GET X$: HOME
103 PRINT "THIS DISPLAY, AS WELL AS THE LATER": PRINT "ONES, IS ACTUAL DATA FOR THIS DISK. ";: GET X$
104 HOME : PRINT "WE WILL DISCUSS THE HEX ENTRIES BY": PRINT "THEIR ADDRESS IN THE WORK BUFFER. (THIS": PRINT "DISPLAY IS THE BUFFER CREATED BY THE": PRINT "'DISK EXAM' PROGRAM.) ";: GET X$
105 HOME
106 PRINT : PRINT "THESE ADDRESSES ARE LISTED DOWN THE": PRINT "LEFT-HAND SIDE IN STEPS OF $08."
107 PRINT : PRINT "FOR EXAMPLE, ADDRESS $0B IS THE": PRINT "FOURTH ONE IN THE SECOND ROW. ";: GET X$
108 HOME
109 PRINT "THE $04 AT $00 IS NOT USED BY DOS.": PRINT "THE NEXT TWO BYTES ($11 0F AT $01-02)": PRINT "ARE THE TRACK AND SECTOR OF THE FIRST": PRINT "CATALOG - IN THIS CASE TRACK $11 (17)": PRINT "SECTOR $0F (15), WHICH IS STANDARD. ";: GET X$
110 HOME : PRINT "THE $03 AT ADDRESS $03 STANDS FOR DOS": PRINT "VERSION 3.3, AND IS ALSO STANDARD.": PRINT : PRINT "ADDRESSES $04-5 AREN'T USED. ";: GET X$
112 HOME : PRINT "THE $01 AT $06 IS THE DISK VOLUME": PRINT "NUMBER, FROM $01 TO $FE (1 - 254).": PRINT : PRINT "ADDRESSES $07 TO $26 AREN'T USED. ";: GET X$
114 HOME : PRINT "THE $7A AT ADDRESS $27 IS THE MAXIMUM": PRINT "NUMBER OF TRACK/SECTOR PAIRS THAT WILL": PRINT "FIT IN ONE FILE TRACK/SECTOR LIST ": PRINT "SECTOR ($7A OR DEC. 122 FOR 256-BYTE": PRINT "SECTORS.) ";: GET X$
116 HOME : PRINT "ADDRESSES $28 TO $2F AREN'T USED.": PRINT : PRINT "THE $19 AT ADDRESS $30 IS THE LAST": PRINT "TRACK WHERE SECTORS WERE ALLOCATED. ";: GET X$
117 HOME : PRINT "THE $01 AT ADDRESS $31 IS THE DIRECTION": PRINT "OF TRACK ALLOCATION: $01 IS +1, AND $FF": PRINT "IS -1. (SEE P. 284 OF INMAN AND INMAN,"
118 PRINT "APPLE MACHINE LANGUAGE, FOR HEX NOTA-": PRINT "TION OF NEGATIVE NUMBERS.) ";: GET X$
119 HOME : PRINT "GIVEN $19 AS THE LAST TRACK ALLOCATED": PRINT "AND +1 AS THE ALLOCATION DIRECTION,": PRINT "THE NEXT TRACK WILL BE THE SUM: $1A (OR": PRINT "DECIMAL 26). ";: GET X$
120 HOME : PRINT "ADDRESSES $32-3 AREN'T USED.": PRINT : PRINT "THE $23 AT ADDRESS $34 IS THE": PRINT "NUMBER OF TRACKS PER DISKETTE -": PRINT "IN THIS CASE $23 (35), NORMAL. ";: GET X$
122 HOME : PRINT "THE $10 AT ADDRESS $36 IS THE": PRINT "NUMBER OF SECTORS PER TRACK - ": PRINT "IN THIS CASE $10 (16), THE NORM": PRINT "FOR DOS 3.3. (IT WOULD BE $0D ": PRINT "OR DEC. 13 FOR DOS 3.2). ";: GET X$
124 HOME : PRINT "THE $00 01 AT ADDRESSES $36-7": PRINT "IS THE LOW AND HIGH BYTES (IE,": PRINT "'BACKWARDS') OF THE NUMBER OF": PRINT "BYTES PER SECTOR - $100 (256). ";: GET X$
126 HOME : PRINT "FROM ADDRESS $38 TO THE END OF THE VTOC": PRINT "(ADDRESS $FF) ARE 4-BYTE BIT MAPS OF": PRINT "EACH SECTOR FROM $0 (0) TO AS MANY AS"
127 PRINT "ARE ON THE DISK (NORMALLY $23 (35),": PRINT "WITH THE 35TH AT ADDRESSES $C0-CF). ";: GET X$
128 HOME : PRINT "ALL ZEROS, AS AT $38-3B (TRACK 0),SHOW": PRINT "ALL SECTORS ARE ALLOCATED. FOUR F'S": PRINT "FOLLOWED BY 4 ZEROS MEANS ALL SECTORS": PRINT "ARE FREE. ";: GET X$
130 HOME : PRINT "IN THE BIT MAP, ONLY THE FIRST": PRINT "TWO BYTES ARE USED. THE FIRST": PRINT "SHOWS USAGE OF SECTORS $8-$F AND": PRINT "THE SECOND USAGE OF $0-$7. ";: GET X$
132 HOME : PRINT "FOR THE 10TH TRACK AT ADDRESSES $60-63:": PRINT "FREE IF 1ST BYTE OF MAP:F E D C B A 9 8": PRINT "FREE IF 2ND BYTE OF MAP:7 6 5 4 3 2 1 0": PRINT "2ND BYTE,$0F,IN BINARY: 0 0 0 0 1 1 1 1": PRINT "10TH TRACK FREE SECTORS: 3,2,1,0";: GET X$
134 HOME : PRINT "IN SUMMARY, THE VTOC CONTAINS THE CATA-": PRINT "LOG POINTERS, DOS VERSION, VOL. #, THE": PRINT "TRACK/SECTOR LIST LENGTH, LAST ALLOCA-"
135 PRINT "TED TRACK & DIRECTION, TRACKS PER DISK,": PRINT "SECTORS/TRACK,BYTES/SECTOR,& BIT MAPS.";: GET X$
136 HOME : PRINT : PRINT "TYPE ANY KEY TO RETURN TO MENU. ";: GET X$
205 PRINT "THIS IS THE FIRST CATALOG SECTOR, TO": PRINT "WHICH THE VTOC POINTED. IT IS NORMALLY": PRINT "LOCATED AT TRACK $11 (17), SECTOR $0F": PRINT "(15). THE SECOND IS AT $11,$0E, THE": PRINT "THIRD AT $11,$0D, AND SO ON. ";: GET X$
208 HOME : PRINT "THE BYTE AT ADDRESS $00 IS NOT USED.": PRINT : PRINT "THE NEXT TWO BYTES ARE THE ADDRESS OF": PRINT "THE NEXT CATALOG SECTOR, $11 (TRACK 17)": PRINT "AND $0E (SECTOR 14). ";: GET X$
209 HOME
210 PRINT "THE BYTES FROM $03 TO $0A ARE NOT USED.": PRINT : PRINT "THE NEXT TWO BYTES ARE THE ADDRESS OF": PRINT "THE FIRST TRACK/SECTOR LIST SECTOR,": PRINT "HERE TRACK $0A (10), SECTOR $0B (11). ";: GET X$
211 HOME
212 PRINT "ADDRESS $0D CONTAINS THE FILE TYPE. THE": PRINT "FIRST DIGIT IS 8 IF LOCKED, 0 IF NOT.": PRINT "THE SECOND DIGIT IS 0 FOR TEXT FILES,": PRINT "1 FOR INTEGER, 2 FOR APPLESOFT, AND 4 ": PRINT "FOR BINARY. ";: GET X$
214 HOME : PRINT "THE $82 AT ADDRESS $0D MEANS A LOCKED": PRINT "APPLESOFT PROGRAM.": PRINT : PRINT "OTHER CODES: 10 = RELOCATABLE FILE;": PRINT "20 = A TYPE; 40 = B TYPE; -8 = S TYPE.";: GET X$
216 HOME : PRINT "THE NEXT 30 BYTES ARE THE FILE NAME.": PRINT "IF LESS THAN 30, $A0'S (BLANKS) ARE": PRINT "ADDED. THE $C8 ADDRESS $0E IS THE 'H'": PRINT "IN 'HELLO': $C8 = 200, WHICH IS ASCII ": PRINT "FOR 'H'. ";: GET X$
218 HOME : PRINT "THE FILE NAME IS TRANSLATED INTO ASCII": PRINT "ON THE RIGHT. NOTE THAT APPLE REPEATS ": PRINT "THE ASCII CODE TWICE (0-128,129-256).": PRINT "TO GET THE ASCII YOU'RE USED TO, CON-": PRINT "VERT TO DECIMAL AND SUBTRACT 128. ";: GET X$
220 HOME : PRINT "THE TWO BYTES RIGHT AFTER THE FILE NAME"
221 PRINT "IS THE FILE LENGTH IN LO/HI BYTE FORM."
222 PRINT "THE NEXT BYTE (ADDRESS $2D) IS ALWAYS": PRINT "A 00 IF THE FILE WAS ESTABLISHED BY DOS": PRINT "COMMANDS.";: GET X$
224 HOME : PRINT "THE REST OF THE CATALOG SECTOR CONTAINS": PRINT "ROOM FOR 6 MORE SETS OF FILE INFORMA-": PRINT "TION (LOCATION OF 1ST TRACK/SECT. LIST,": PRINT "FILE TYPE, FILE NAME, AND LENGTH.) ";: GET X$
226 HOME : PRINT "WITH 7 FILES PER CATALOG SECTOR AND 15 ": PRINT "POTENTIAL CATALOG SECTORS (TRACK $11,": PRINT "SECTORS $0F TO $01), DOS 3.3 COULD": PRINT "HANDLE 105 FILES! ";: GET X$
230 HOME : PRINT : PRINT "TYPE ANY KEY TO RETURN TO MENU. ";: GET X$
306 PRINT "THIS IS THE TRACK/SECTOR LIST SECTOR ": PRINT "FOR THE 'HELLO' PROGRAM. THE T/S LIST": PRINT "GIVES, IN ORDER, THE TRACKS AND SECTORS": PRINT "WHICH A GIVEN PROGRAM TAKES UP ON THE": PRINT "DISK. THESE CAN BE ANYWHERE ON DISK. ";: GET X$
308 HOME : PRINT "THE T/S LIST SECTOR CAN HANDLE FILES": PRINT "UP TO 122 SECTORS LONG. IF MORE ARE RE-": PRINT "QUIRED, THERE MUST BE ONE OR MORE ADDI-": PRINT "TIONAL T/S LISTS FOR THE FILE. ";: GET X$
310 HOME : PRINT "THE FIRST BYTE (AT $00) ISN'T USED.": PRINT : PRINT "THE NEXT TWO BYTES (AT $01,$02) ARE THE": PRINT "ADDRESS, IF ANY, OF THE NEXT T/S LIST": PRINT "SECTOR REQUIRED BY LONG FILES. ";: GET X$
312 HOME : PRINT "ADDRESSES $03-$04 ARE THE SECTOR OFFSET": PRINT "OF THE 1ST SECTOR, IF ANY.": PRINT : PRINT "ADDRESSES $07 - $0B AREN'T USED. ";: GET X$
314 HOME : PRINT "THE PAIRS OF BYTES STARTING AT $0C-$0D": PRINT "ARE THE TRACKS & SECTORS FOR THIS FILE.": PRINT : PRINT "THE 'HELLO' PROGRAM'S 1ST DATA SECTOR ": PRINT "IS AT TRACK $0A (10), SECTOR $0A (10).)";: GET X$
315 HOME : PRINT "THE 'HELLO' PROGRAM IS FOUR SECTORS ": PRINT "LONG IN THIS EXAMPLE. ";: GET X$
316 HOME : PRINT "TYPE ANY KEY TO SEE THE FIRST SECTOR": PRINT "OF THE 'HELLO' PROGRAM (TRACK $0A,": PRINT "SECTOR $0A.)";: GET X$
342 PRINT "THIS IS THE FIRST SECTOR OF THE 'HELLO'": PRINT "PROGRAM. IT IS COMPOSED OF ASCII CHAR-": PRINT "ACTERS, APPLESOFT COMMAND TOKENS, AND": PRINT "A FEW MEMORY POINTERS. ";: GET X$
344 HOME : PRINT "FOR ASCII CODES SEE P. 138 OF THE": PRINT "APPLESOFT MANUAL, OR RUN THE 'ASCII'": PRINT "CODES' PROGRAM ON THIS DISK. FOR APPLE": PRINT "COMMAND TOKENS SEE P. 121 OR RUN THE": PRINT "'COMMAND TOKENS/ADDRESSES' PROGRAM. ";: GET X$
346 HOME : PRINT "THE FIRST TWO BYTES ARE THE PROGRAM'S": PRINT "LENGTH, LOW BYTE FIRST. THUS THE LENGTH": PRINT "IS $03F5, OR DECIMAL 1,013. ";: GET X$
348 HOME : PRINT "EVERYTHING FROM ADDRESS $03 ON IS THE": PRINT "PROGRAM. APPLESOFT PROGRAMS HAVE THIS": PRINT "FORMAT: TWO BYTES FOR THE MEMORY LOCA-"
349 PRINT "TION OF THE NEXT LINE, TWO BYTES FOR ": PRINT "THE LINE #, THE LINE, AND A ZERO BYTE. ";: GET X$
350 HOME : PRINT "THE NEXT LINE IS AT MEMORY LOCATION": PRINT "$A0A AND IT IS LINE # 5. IT IS FOUR": PRINT "BYTES LONG PLUS THE ZERO BYTE AT": PRINT "ADDRESS $0A. ";: GET X$
352 HOME : PRINT "THE FIRST LINE:": PRINT " $A5 AT ADDRESS $06 IS THE TOKEN FOR": PRINT "'ONERR'; $AB IS TOKEN FOR GOTO; THE 31": PRINT "AND 30 ARE ASCII FOR 1 AND 0; THE $00 ": PRINT "ENDS THE LINE: ONERR GOTO 10 ";: GET X$
354 HOME : PRINT "THE 3RD LINE WILL START AT MEMORY LOCA-": PRINT "TION $A1A (SEE ADDRESSES $0B,$0C), AND": PRINT "THE 2ND LINE # IS 10 ($0A). ";: GET X$
356 HOME : PRINT "THE SECOND LINE AT ADDRESS $0F:": PRINT " $89=TEXT; $3A=:; $97=HOME: $3A=:; ": PRINT "$A9=SPEED=; $32 $35 $35 = 2 5 5; $3A=:": PRINT "$A2=VTAB; $38=8; $00=END OF LINE": PRINT "10 TEXT:HOME:SPEED=255:VTAB 8 ";: GET X$
358 HOME : PRINT : PRINT "TYPE ANY KEY TO RETURN TO MENU. ";: GET X$
406 PRINT "THIS IS A CATALOG SECTOR AS DISPLAYED": PRINT "BY THE 'BYTE ZAP' PROGRAM. IT IS THE": PRINT "SAME HEX DISPLAY RECODED FOR CATALOG": PRINT "FORMAT. ";: GET X$
408 HOME : PRINT "WHEN DOS DELETES A FILE IT DOESN'T ": PRINT "ERASE IT - IT JUST WRITES $FF AS THE ": PRINT "TRACK/SECTOR LIST POINTER AND MOVES THE": PRINT "OLD VALUE TO THE LEFT. TO UNDELETE A": PRINT "FILE WE JUST PUT IT BACK. ";: GET X$
410 HOME : PRINT "THIS UNDELETING ONLY WORKS WHEN THE DOS": PRINT "FILE MANAGER HASN'T SAVED SOME OTHER ": PRINT "FILE ON TOP OF THE FILE YOU WANT TO": PRINT "UNDELETE. ";: GET X$
412 HOME : PRINT "IN THE EXAMPLE ABOVE, WE CHANGE THE $FF": PRINT "FOR THE DELETE FILE 'DISK AIDS' TO $0E": PRINT "(THE OLD VALUE STORED AT THE RIGHT),": PRINT "THEN POKE BLANKS ($A0'S OVER THE OLD": PRINT "$0E AT THE RIGHT.) ";: GET X$
414 HOME : PRINT "IN THIS CASE, SUCH A CHANGE": PRINT "WOULD DO NOT GOOD SINCE WE CAN": PRINT "SEE THAT THE FILE 'RWDISC' IS ": PRINT "ALREADY SAVED AT TRACK $0E, SECTOR $0F. ";: GET X$
416 HOME : PRINT "TYPE ANY KEY TO RETURN TO MENU. ";: GET X$
504 PRINT "CHANGING CATALOG NAMES IS JUST A MATTER": PRINT "OF USING A DISK ZAP PROGRAM TO CHANGE": PRINT "THE HEX ENTRIES FOR THE NAMES IN THE ": PRINT "CATALOG. REMEMBER NAMES ARE 30 CHARAC-": PRINT "TERS OR LESS. ";: GET X$
506 HOME : PRINT "TYPE ANY KEY TO RETURN TO MENU. ";: GET X$
604 PRINT "THE NAME OF THE GREETING PROGRAM IS": PRINT "STORED IN TRACK $01, SECTOR $09, WHERE": PRINT "YOU SEE THE WORD 'HELLO'. JUST POKE ": PRINT "YOUR NEW NAME THERE (UP TO 30 CHARS.)";: GET X$
605 HOME
606 PRINT "NOTE THIS IS WHERE YOU COULD ALSO": PRINT "CHANGE ERROR MESSAGES (T$01,S$08-9) OR": PRINT "DOS COMMAND NAMES (T$01,S$07). ";: GET X$
608 HOME : PRINT "TYPE ANY KEY TO RETURN TO MENU. ";
704 PRINT "THE CATALOG HEADING NORMALLY READS ": PRINT "'DISK VOLUME'. ON THE DISK ABOVE IT IS": PRINT "CALLED 'DISK AIDS'. THIS HEADING IS": PRINT "FOUND ON TRACK $02, SECTOR #02, AT AD-": PRINT "DRESSES $B0 TO $BA, SPELLED BACKWARDS.";: GET X$
705 HOME
706 PRINT "TO CHANGE THE HEADING JUST USE A DISK ": PRINT "ZAP UTILITY TO CHANGE ADDRESSES $B0": PRINT "TO $BA TO WHAT YOU WANT. ";: GET X$
1553 KEY = PEEK( -16384): IF KEY <128 THEN C = C +1 -L *(C = L): GOTO 1552
1554 POKE -16368,0: SPEED= 255: RETURN
1555 W = W +1: VTAB 10: HTAB 1 +(W - INT(W/2) *2 = 0): PRINT SPC( 1);"ANALYZING..."; SPC( 1)
1556 FOR I = 1 TO 250: NEXT : IF W <10 THEN 1555
1557 RETURN : REM - SUBROUTINE DURING ANALYZING
2000 REM <CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H><CTRL-H> <CTRL-M>********************************<CTRL-M> PLACE IN THE PUBLIC DOMAIN BY<CTRL-M> DAVE GARSON, JULY 1, 1982<CTRL-M>********************************<CTRL-M>
63000 HOME : PRINT "REMARK WRITER/FORMATTER BY JON VOSKUIL"
63150 INVERSE : FOR I = 1 TO N: PRINT "H";: NEXT I: NORMAL
63160 PRINT SPC( N);: INVERSE : PRINT "M";: NORMAL : IF R$ < >"" THEN FOR I = 1 TO 32: PRINT R$;: NEXT I: INVERSE : PRINT "M";: NORMAL
63170 FOR I = 1 TO PART: PRINT SPC( 16 - LEN(R$(I))/2);R$(I);: INVERSE : PRINT "M";: NORMAL : NEXT I: IF R$ < >"" THEN FOR I = 1 TO 32: PRINT R$;: NEXT I: INVERSE : PRINT "M";: NORMAL
63180 VTAB 3: HTAB 1: PRINT "COPY WITH RIGHT ARROW:": VTAB 7: END
63190 POKE -16368,0: PRINT C$;B$;:R$ = ""
63200 C = PEEK( -16384): IF C >127 THEN 63240
63210 T = T +1: IF T <5 THEN 63200
63220 IF F THEN PRINT " ";B$;:F = 0:T = 0: GOTO 63200
63230 PRINT C$;B$;:F = 1:T = 0: GOTO 63200
63240 POKE -16368,0:C = C -128: IF C = 13 THEN PRINT " ": RETURN
63250 IF C < >8 THEN PRINT CHR$(C);C$;B$;:R$ = R$ + CHR$(C): GOTO 63200
63260 IF R$ >"" THEN PRINT " ";B$;B$;C$;B$;: IF LEN(R$) >1 THEN R$ = LEFT$(R$, LEN(R$) -1): GOTO 63200